﻿// Original author contact info: Owen Emlen (owene_1998@yahoo.com)
// Note: other individuals may also have contributed to this code
// Project hosted on CodePlex.com as of 1/10/2009 at http://www.codeplex.com/EmlenMud
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BrainTechLLC;
using BrainTechLLC.ThreadSafeObjects;

namespace UserInterface
{
	public partial class StringCommandToPerformPairEditor : UserControl
	{
		protected List<IdentifierAndValue> _stringsAndCommands;
		protected List<IdentifierAndValue> StringsAndCommands
		{
			get
			{
				return _stringsAndCommands;
			}
			set
			{
				_stringsAndCommands = value;
				UpdateBindings();
			}
		}

		public void SetItem(ThreadSafeLookup<string, CommandToPerform> items)
		{
			List<IdentifierAndValue> list = new List<IdentifierAndValue>();
			foreach (var v in items.AllKeyValuePairs)
			{
				list.Add(new IdentifierAndValue(v.Key, v.Value));
			}
			StringsAndCommands = list;
		}

		public void UpdateBindings()
		{
			if (_stringsAndCommands != null)
			{
				//abilityBindingSource.DataSource = _abilityList.ReadItems<BrainTechLLC.Ability>();
			}
		}

		public StringCommandToPerformPairEditor()
		{
			InitializeComponent();
		}

		private void identifierAndValueDataGridView_SelectionChanged(object sender, EventArgs e)
		{

		}
	}

}
